package com.imooc.food.controller;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.imooc.food.service.RabbitMessageService;
import com.imooc.food.service.SendMessage;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * ProjectName food
 *
 * @author xieyucan
 * <br>CreateDate 2022/9/22 17:56
 */
@RestController
@RequestMapping("/order")
public class OrderDetailController {

    private final SendMessage sendMessage;

    public OrderDetailController(SendMessage sendMessage) {
        this.sendMessage = sendMessage;
    }

    @PostMapping("/sendPractice")
    public void sendPractice() throws JsonProcessingException {
        sendMessage.sendPractice();
    }

    @PostMapping("/sendFanout")
    public void sendFanout() throws JsonProcessingException {
        sendMessage.sendFanout();
    }
}
